﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CUIT.GraduationProject.ToolBoxSystem.ControlData;

namespace CUIT.GraduationProject.ToolBoxSystem.ControlFactory
{
    /// <summary>
    ///  创建控件工厂类
    /// </summary>
    public class CreateControlFactory
    {

        /// <summary>
        ///  创建控件方法
        /// </summary>
        /// <param name="controlType">空间类型</param>
        /// <returns>new 控件</returns>
        public static Control NewControl(ControlType controlType)
        {
            Control con = null;
            switch (controlType)
            {
                case ControlType.Button: con = new Button(); break;
                case ControlType.TextBox: con = new TextBox(); break;
                default: break;
            }

            return con;
        }
    }
}
